package gtgold;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

public class TrailDataManager
{
	public final static Map<String, Location> locations;

	public final static Location startLocation;
	public final static Location endLocation;
	
	//Can be safely queried for isShop,etc (Always false)
	public final static Location nullLocation = new Location("", null, null);

	static
	{
		Map<String, Location> templocations = new HashMap<String, Location>();

		// initialization code auto generated from script
		templocations.put(
				"Independence",
				new Location("Independence", new ItemVec().set(Item.AXLES, 10)
						.set(Item.OXEN, 20).set(Item.FOOD, 0.2)
						.set(Item.BULLETS, 2).set(Item.WHEELS, 10)
						.set(Item.TOUNGES, 10).set(Item.CLOTHES, 10), null,
						new TrailSegment("Kansas River", 102)));
		templocations.put("Kansas River", new Location("Kansas River", null,
				new LocationRiverData(true, false, 5.4), new TrailSegment(
						"Big Blue River", 83)));
		templocations.put("Big Blue River", new Location("Big Blue River",
				null, new LocationRiverData(false, false, 3.0),
				new TrailSegment("Fort Kearney", 120)));
		templocations.put(
				"Fort Kearney",
				new Location("Fort Kearney", new ItemVec()
						.set(Item.AXLES, 12.5).set(Item.OXEN, 25)
						.set(Item.FOOD, 0.25).set(Item.BULLETS, 2.4)
						.set(Item.WHEELS, 12.5).set(Item.TOUNGES, 12.5)
						.set(Item.CLOTHES, 12.5), null, new TrailSegment(
						"Chimney Rock", 250)));
		templocations.put("Chimney Rock", new Location("Chimney Rock", null,
				null, new TrailSegment("Fort Laramie", 86)));
		templocations.put(
				"Fort Laramie",
				new Location("Fort Laramie", new ItemVec().set(Item.AXLES, 15)
						.set(Item.OXEN, 30).set(Item.FOOD, 0.3)
						.set(Item.BULLETS, 3).set(Item.WHEELS, 15)
						.set(Item.TOUNGES, 15).set(Item.CLOTHES, 15), null,
						new TrailSegment("Independence Rock", 190)));
		templocations.put("Independence Rock", new Location(
				"Independence Rock", null, null, new TrailSegment("South Pass",
						102)));
		templocations.put("South Pass", new Location("South Pass", null, null,
				new TrailSegment("Fort Bridger", 57), new TrailSegment(
						"Green River", 125)));
		templocations.put(
				"Fort Bridger",
				new Location("Fort Bridger", new ItemVec()
						.set(Item.AXLES, 17.5).set(Item.OXEN, 35)
						.set(Item.FOOD, 0.35).set(Item.BULLETS, 3.4)
						.set(Item.WHEELS, 17.5).set(Item.TOUNGES, 17.5)
						.set(Item.CLOTHES, 17.5), null, new TrailSegment(
						"Green River", 162)));
		templocations.put("Green River", new Location("Green River", null,
				new LocationRiverData(true, false, 41.0), new TrailSegment(
						"Soda Springs", 144)));
		templocations.put("Soda Springs", new Location("Soda Springs", null,
				null, new TrailSegment("Fort Hall", 57)));
		templocations.put("Fort Hall", new Location("Fort Hall", new ItemVec()
				.set(Item.AXLES, 20).set(Item.OXEN, 40).set(Item.FOOD, 0.4)
				.set(Item.BULLETS, 4).set(Item.WHEELS, 20)
				.set(Item.TOUNGES, 20).set(Item.CLOTHES, 20), null,
				new TrailSegment("Snake River", 182)));
		templocations.put("Snake River", new Location("Snake River", null,
				new LocationRiverData(false, true, 12.0), new TrailSegment(
						"Fort Boise", 114)));
		templocations.put(
				"Fort Boise",
				new Location("Fort Boise", new ItemVec().set(Item.AXLES, 22.5)
						.set(Item.OXEN, 45).set(Item.FOOD, 0.45)
						.set(Item.BULLETS, 4.4).set(Item.WHEELS, 22.5)
						.set(Item.TOUNGES, 22.5).set(Item.CLOTHES, 22.5), null,
						new TrailSegment("Grande Ronde", 160)));
		templocations.put("Grande Ronde", new Location("Grande Ronde", null,
				null, new TrailSegment("Fort Walla Walla", 55),
				new TrailSegment("The Dalles", 125)));
		templocations.put(
				"Fort Walla Walla",
				new Location("Fort Walla Walla", new ItemVec()
						.set(Item.AXLES, 25).set(Item.OXEN, 50)
						.set(Item.FOOD, 0.5).set(Item.BULLETS, 5)
						.set(Item.WHEELS, 25).set(Item.TOUNGES, 25)
						.set(Item.CLOTHES, 25), null, new TrailSegment(
						"The Dalles", 120)));
		templocations.put("The Dalles", new Location("The Dalles", null, null,
				new TrailSegment("Willamette Valley", 100)));
		templocations.put("Willamette Valley", new Location(
				"Willamette Valley", null, null));

		// /////////////////////////////////////////////////////////////////////////////////
		locations = Collections.unmodifiableMap(templocations);
		startLocation = locations.get("Independence");
		endLocation = locations.get("Willamette Valley");
	}

	// For testing
	@SuppressWarnings("unused")
	private static void print(String s)
	{
		System.out.println(s);
	}
}
